import javax.rmi.ssl.SslRMIClientSocketFactory;
import java.util.Objects;
import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:运算符详解  逻辑控制  作业
 * User:岁亮亮
 * Date:2023-12-29
 * TIME:16:53
 */


public class JDemo {
    public static void main(String[] args) {//  多组输入
        Scanner num=new Scanner(System.in);
        while(num.hasNextInt()){
            int n=num.nextInt();
            int a=num.nextInt();
            System.out.println("hehe");


        }
    }
    public static void main23(String[] args) {//当两个字符串无法保证都不为空时
        boolean ret = Objects.equals("a", "a");//iji
        boolean ret2 = Objects.equals(new String("aa 12"), new String("aa 12"));
        boolean ret3 = Objects.equals(null, null);

        //compareTo()方法  相等返回0;不相等两个字符的差
        String str="a";
        String  str2="A";
        System.out.println("str.compareTo(str2)结果是  "+str.compareTo(str2));//32
        System.out.println("str2.compareTo(str)结果是  "+str2.compareTo(str));//-32
    }

    public static void main22(String[] args) {//判断两个字符是否相等
        Scanner input = new Scanner(System.in);
        String name = new String("abc 123");
        /*if(name==str)
        {
            System.out.println("true");//比较索引值相等
        }*/
        int i = 0;
        for (i = 3; i > 0; i--) {
            System.out.println("请输入密码还有 "+i+"次机会");
            String str = input.nextLine();//输入密码
            if (name.equals(str)) {
                System.out.println("输入正确 ");
                break;
            } else {
                System.out.println("输入错误请重新输入");
            }
        }
        if (i == 0) {
            System.out.println("超过失败次数退出程序");
        }


    }

    public static void main18(String[] args) {//9出现的次数
        int count = 0;
        for (int i = 1; i < 101; i++) {
            if (i % 10 == 9) {
                count++;
            }
            if (i / 10 == 9) {
                count++;
            }
        }
        System.out.println("1~100一共出现了 " + count + "个数字9");
    }

    public static void main24(String[] args) {//位运算输出奇偶序列2
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println("奇数是 ");
        for (int i = 31; i >=0 ; i-=2) {
            System.out.print(((n>>>i)&1)+" ");
        }
        System.out.println();
        System.out.println("偶数是 ");
        for (int i = 30; i >=0 ; i-=2) {
            System.out.print(((n >>> i) & 1) + " ");
        }
    }

    public static void main188(String[] args) {//位运算输出奇偶序列
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int b = n >> 1;
        System.out.print("奇数是 ");
        for (int i = 1; i <= 16; n = n >> 2, i++) {
            System.out.print(n&1);
        }
        System.out.println();
        System.out.print("偶数是 ");
        for (int i = 1; i <= 16; b = b >> 2, i++) {
            System.out.print(b&1);

        }
    }

    public static void main26(String[] args) {//位运算求1的个数2
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count=0;
        while(n!=0){
            count++;
            n=n&(n-1);
        }
        System.out.println(count);
    }

    public static void main16(String[] args) {//位运算求1的个数
        int a = 9;
        int b = a;
        int count = 0;
        for (int i = 1; i <= 32; b = b >> 1, i++) {
            int c = b & 1;
            if (c == 1) {
                count++;
            }
        }
        System.out.println(count);
    }


    public static void main15(String[] args) {//最大工倍数
        System.out.println("请输入两个数字");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int ret = scanner.nextInt();
        /*int i = num > ret ? num : ret;
        int b = num > ret ? ret : num;*/
        int a = 0;
        int b = num;
        int c = ret;
        while (num % ret != 0 && a != 1) {
            a = num % ret;
            num = ret;
            ret = a;
        }
        if (a == 1) {
            System.out.println("最小公约数是 " + 1);
            System.out.println("最大公倍数是 " + b * c);
        } else {
            int flag = ret * (b / ret) * (c / ret);
            System.out.println("最小公约数是 " + ret);
            System.out.println("最大公倍数是 " + flag);
        }
    }


    public static void main13(String[] args) {//最小公yue数2
        System.out.println("请输入两个数字");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int ret = scanner.nextInt();
        /*int i = num > ret ? num : ret;
        int b = num > ret ? ret : num;*/
        int a = 0;
        while (num % ret != 0 && a != 1) {
            a = num % ret;
            num = ret;
            ret = a;
        }
        if (a == 1) {
            System.out.println("最小公倍数是" + 1);
        } else {
            System.out.println("最小公倍数是" + ret);
        }


    }

    public static void mainI1(String[] args) {//最小公倍数1
        System.out.println("请输入两个数字");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int ret = scanner.nextInt();
        int i = num > ret ? ret : num;
        int flag = 0;
        for (int j = 2; j <= i; j++) {
            if (num % j == 0 && ret % j == 0) {
                flag = 1;
                System.out.println("最小公倍数是");
                System.out.println(j);
                break;
            }
        }
        if (flag == 0) {
            System.out.println('1');

        }

    }

    public static void main11(String[] args) {//乘法口诀表
        for (int i = 1; i <= 9; i++) {
            for (int n = 1; n <= i; n++) {
                int v = i * n;
                System.out.print(i + "*" + n + "=" + v + "  ");
            }
            System.out.print("\n");
        }
    }

    public static void main10(String[] args) {//素数
        int num = 5;
        int count = 0;
        int i = 0;
        for (num = 5; num < 100; num++) {
            for (i = 2; i * i <= num; i++) {//或者for(i=2;i<=Math.sqrt(num)
                if (num % i == 0) {
                    break;
                }
            }
            if (i * i > num) {
                count++;
                System.out.print(num);
            }

        }
        System.out.println("一共有" + count + "素数");
    }

    public static void main9(String[] args) { //水仙花数  153=1*3+5^3+3^3
        for (int num = 100; num < 1000; num++) {
            int a = num % 10;
            int b = num / 10 % 10;
            int c = num / 100;
            if (num == a * a * a + b * b * b + c * c * c) {
                System.out.println(num);
            }
        }
    }

    public static void main8(String[] args) {
        Random random = new Random();
        int randNum = random.nextInt(100);
        System.out.println("随机数是  " + randNum);
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("请输入数字  ");
            int num = scanner.nextInt();
            if (num == randNum) {
                System.out.println("正确 ");
                break;
            }
            if (num < randNum) {
                System.out.println("小了 ");
            }
            if (num > randNum) {
                System.out.println("大了 ");
            }

        }
    }

    public static void main7(String[] args) {
        Random random = new Random();
        int randNum = random.nextInt(100);
        System.out.println("随机数是 " + randNum);
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("请输入数字 ");
            int num = scanner.nextInt();
            if (num == randNum) {
                System.out.println("输入正确 ");
                break;
            }
            if (num < randNum) {
                System.out.println("输入小了");
            }
            if (num > randNum) {
                System.out.println("大量");
            }
        }
    }

    public static void main6(String[] args) {
        Random random = new Random();
        int randNum = random.nextInt(100);
        System.out.println("随机数是" + randNum);
        Scanner scanner = new Scanner(System.in);

        while (true) {
            System.out.println("请输入数字");
            int num = scanner.nextInt();
            if (num == randNum) {
                System.out.println("输入正确");
                break;
            }
            if (num < randNum) {
                System.out.println("小了");
            }
            if (num > randNum) {
                System.out.println("大了");
            }
        }
    }

    public static void main5(String[] args) {
        System.out.println("");
    }

    public static void main4(String[] args) {
        int i = 1;
        while (i <= 100) {
            if (i % 3 == 0 && i % 5 == 0) {
                System.out.println(i);
                i++;
                continue;
            }
            i++;

        }
    }

    public static void main3(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 5; i++) {

            int ret = 1;
            for (int n = 1; n <= i; n++) {
                ret *= n;
            }
            sum += ret;
        }
        System.out.println(sum);
    }

    public static void main2(String[] args) {
        int i = 1;
        int sum = 0;
        while (i <= 5) {
            int c = 1;
            int ret = 1;
            while (c <= i) {
                ret *= c;
                c++;
            }
            i++;
            sum += ret;
        }
        System.out.println(sum);
    }

    public static void main1(String[] args) {
        int a = 2;//switch只是用于byte short char string int
        // 不适用于long float double boolean
        switch (a) {
            case 1:
        }
        int c = 1;
        int ret = 1;
        while (c <= 5) {
            ret *= c;
            c++;
        }
        System.out.println(ret);//5!的

    }

    public static void mainInt(String[] args) {
        int b = 1;
        //System.out.println(a==1);//打印ture;
        System.out.println(10 < 20 || 10 / 0 == 0);//直接打印ture不执行第二条语句
        System.out.println(10 > 20 && 10 / 0 == 0);//打印false
        boolean flg = true == true ? false ? true : false : true;
        System.out.println(flg);//false
        System.out.println(1 >>> 1);//无符号右移  没有<<<左移;
        int a = 4;
        double v = 2.0;
        a += v;
        System.out.println(a);//打印6  +=自动转换为int
        //ctrl+alt+l 对齐格式
        //if(a)也就不行 a是整型不是boolean
        /*if(a==4){
            ;
        }
        else{         //java风格;
            ;
        }*/
        String str = "123";
        int num = Integer.valueOf(str);
        System.out.println(num);//strinf.>int;
        int bun = 1234;
        String str2 = String.valueOf(bun);
        System.out.println(str2);//int>>string
        String str3 = bun + "";
        System.out.println(str3);
    }
}
